package jmine.tec.utils.date;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * Enum that contains the months of the year.
 * 
 * @author Rafael Volpato
 * @date Dec 4, 2009
 */
public enum MonthEnum implements MessageCreator {

    JANUARY("utils.months.january"),

    FEBRUARY("utils.months.february"),

    MARCH("utils.months.march"),

    APRIL("utils.months.april"),

    MAY("utils.months.may"),

    JUNE("utils.months.june"),

    JULY("utils.months.july"),

    AUGUST("utils.months.august"),

    SEPTEMBER("utils.months.september"),

    OCTOBER("utils.months.october"),

    NOVEMBER("utils.months.november"),

    DECEMBER("utils.months.december");

    private final MessageCreator monthName;

    /**
     * C'tor
     * 
     * @param nameKey - name of the month
     */
    private MonthEnum(String nameKey) {
        this.monthName = MessageCreatorHelper.creator("jmine-tec-utils-messages", nameKey, 0);
    }

    /**
     * @return the monthName
     */
    public LocalizedMessageHolder getMonthName() {
        return this.monthName.create();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return this.getMonthName().getMessage();
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.monthName.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.monthName.getExpectedArguments();
    }
}
